
f = open('C:/Documents and Settings/wang322/Desktop/1.prm','r')
#f = open('1.prm','r')
line = f.readline()

a = ""
while line:
    a += line
    line = f.readline()
f.close()


output_1 = a[:38]

output_2 = a[75:155]
pop_file = "C:/_DATA/CancerData/test/Jun08/satscan/cancer.pop"
output_3 = a[192:236]
coor_file = "C:/_DATA/CancerData/test/Jun08/satscan/cancer.geo"
output_4 = a[273:1417]

output_5 = a[1446:]

print '========================'

for i in range(0, 1000):
    case_file = "C:/_DATA/CancerData/test/Jun08/satscan/"+str(i)+".cas"
    result_file = "C:/_DATA/CancerData/test/Jun08/satscan/l" + str(i)
    output = output_1 + case_file + output_2 + pop_file + output_3 + coor_file + output_4 + result_file + output_5
    filename = 'C:/_DATA/CancerData/test/Jun08/satscan/' + str(i) + '.prm'
    f = open(filename,'w')
    f.write(output)
    f.close()

print output
print "Done!"